<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>

<head>
<title><spring:message code="sp.createnewpayee.title" /></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<script src="<c:url value="/javascripts/common.js"/>"></script>
<script language="javascript">
 
	 function validateForm(){
		 return (validate_required(document.getElementById("email"),'Please enter email address.')
				&& validate_required(document.getElementById("firstName"),'Please enter first name.')
				&& validate_required(document.getElementById("lastName"),'Please enter last name.')
				&& validate_required(document.getElementById("password"),'Please enter password.')
				&& validatePassword()
				 );
	 }
</script>

</head>

<body>
<div class="page"><%@include file="../top_menu.jsp"%>
<table width=100%>
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/payee_menu.jsp" /></td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>

</table>
<div class="contentArea">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
	<tr>
		<td valign="top"></td>
		<td valign="top">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">

			<tr>
				<td colspan="2">
				<form:form commandName="payee" method="post" onsubmit="return validateForm()">
					<table width=70% class="formTable">
						<tr class="formHeader">
							<td colspan="2" align="left"><b><spring:message code="sp.createnewpayee.label.createnewpayee" /></b></td>
						</tr>
						<tr>
							<td colspan="2"><font color="red">${emailAddressAlreadyPresent}</font></td>
						</tr>
						 
							  
						 
						<tr>
							<td align="left" width="40%"><spring:message code="sp.createnewpayee.label.role" /></td>
							<td><form:select path="role.id">
								<c:forEach items="${roleList}" var="item" varStatus="i">
									<form:option value="${item.id}">${item.name}</form:option>
								</c:forEach>
								<input type="hidden" name="level1UserID" value="${sp_id}" /> 
							</form:select></td>
						</tr>
						<tr>
							<td><spring:message code="sp.createnewpayee.label.email" /><font color=red>*</font></td>
							<td><form:input path="email" size="40" />
							<div class="errors"><form:errors path="email" /></div>
							</td>

						</tr>

						<tr>
							<td><spring:message code="sp.createnewpayee.label.alternateemail" /><font color=white>&nbsp;</font></td>
							<td>
							<table border="0">
								<tr>
									<td><form:input path="alternateEmail" size="40" />
									<div class="errors"><form:errors path="alternateEmail" /></div>
									</td>

								</tr>
							</table>
							</td>
						</tr>


						<tr>
							<td><spring:message code="sp.createnewpayee.label.password" /><font color=red>*</font></td>
							<td><form:password path="password" size="40" />
							<div class="errors"><form:errors path="password" /></div>
							</td>
						</tr>

						<tr>
							<td><spring:message code="sp.createnewpayee.label.confirmpassword" /> <font color=red>*</font></td>
							<td><form:password path="confirmPassword" size="40" />
							<div class="errors"><form:errors path="confirmPassword" /></div>
							</td>
						</tr>
						<tr>
							<td><spring:message code="sp.createnewpayee.label.firstname" /><font color=red>*</font></td>
							<td><form:input path="firstName" size="40" />
							<div class="errors"><form:errors path="firstName" /></div>
							</td>

						</tr>
						<tr>
							<td><spring:message code="sp.createnewpayee.label.lastname" /><font color=red>*</font></td>
							<td><form:input path="lastName" size="40" />
							<div class="errors"><form:errors path="lastName" /></div>
							</td>

						</tr>
						
						<tr>
							<td><spring:message code="sp.createnewpayee.label.active" /></td>
							<td><form:checkbox path="enabled" /> <font color=red><spring:message code="sp.createnewpayee.label.activepleasecheckboxtext" /></font> <!--			    		<form:select path="enabled">-->
							<!--			    			<form:option value="true">True</form:option>--> <!--			    			<form:option value="false">False</form:option>-->
							<!--			    		</form:select>--></td>


						</tr>





						<tr>
							<td colspan="2">&nbsp;</td>
						</tr>

						<tr>
							<td colspan="2" align="center"><input type="submit" class='ui-button ui-state-default ui-corner-all'
								id="createPayee" value="<spring:message code="sp.createnewpayee.button.save" />" /> <input type="button" class='ui-button ui-state-default ui-corner-all'
								value="<spring:message code="sp.createnewpayee.button.cancel" />" onclick="location.href='view_payees.htm'" /></td>
						</tr>
					</table>
				</form:form></td>
			</tr>
		</table>
		</td>
	</tr>

	<script language="javascript">
	function validatePassword() {
		var password1 = document.getElementById("password").value;
		var password2 = document.getElementById("confirmPassword").value;

		if (password1 != password2) {
			alert("Please enter password and confirm password the same value");
			return false;
		}
		return true;
	}
</script>

</table>
</div>
</div><%@include file="/WEB-INF/jsp/include/footer.jsp"%>
</body>
</html>
